<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html lang="zh-CN">
  <head>
    <base href="<%=basePath%>">
 
    <title>待认证用户管理</title>
    <!-- 前端模板部分 -->
  	<script type="text/template"  id="teamList">
		<|  for(var i = 0; i<list.length;i++){
		       var item = list[i];
		|>
 
  		           <tr>
			          <th scope='row'><|=i+1 |></th>
			          <td> <|=item.type==1? '个人用户':(item.type==2? '公司用户':'') |> </td>
			          <td> <|=item.phone |> </td>
			          <td> <|=item.cityname |> </td>
			          <td> <|=item.createTime |></td>
			          <td> <|=item.remianSpacePercent |></td>                 
			          <td><a class="btn btn-xs am-actionA"  <|=item.authentication==1? 'disabled':'' |>  href="javascript:to_authentication(<|=item.authentication |>,<|=item.type |>,<|=item.id |>)" role="button">
                          <| if(item.authentication==0||item.authentication==3){|>
                                                               未认证
                          <|}|>
                          <| if(item.authentication==1){|>
                                                              认证通过
                          <|}|>
                          <| if(item.authentication==2){|>
                                                              认证不通过
                          <|}|>
                          </a></td>
			       </tr>
 
		 <|}|>
 
	</script>
	  <!-- 页面结构结束 -->
  </head>
  
  <body class="console-body">
        <jsp:include page="../common/console.jsp"></jsp:include>
  	
  	<div class="console-list">
  		<div class="console-listSolid">&nbsp;</div>
  		<div class="console-listContent">
	  		<div class="console-listHead clearfix">
				<form class="navbar-form navbar-left" role="search" method="get" action="after/user/approve_user_list">
					<div class="form-group">
					 	<input type="text" name="phone" class="form-control" placeholder="手机号..."  value="${param.phone}">
					</div>
					<button type="submit" class="btn btn-default">搜索</button>
				</form>
	  		</div>
	  	
	  		<div class="console-listTable">
		  		<table class="table table-hover">
			      <thead>
			        <tr>
			          <th>编号</th>
			          <th>用户类型</th>
			          <th>手机号</th>
			          <th>所在地</th>
			          <th>注册时间</th>
			          <th>私有空间剩余</th>
			          <th>操作</th>
			        </tr>
			      </thead>
			      
			      <tbody id="container" >
			      
			      </tbody>
			      
			    </table>
			    
				<nav class="clearfix">
				
					<c:if test="${datas.total > 0}">
						<jsp:include page="/jsp/pager.jsp">
							<jsp:param value="${datas.total}" name="totalRecord"/>
							<jsp:param value="after/user/approve_user_list" name="url"/>
						    <jsp:param value="<%=request.getQueryString()%>" name="query"/>
						</jsp:include>
					</c:if>

				</nav>
		    </div>
  		</div>
  	</div><!-- console-list -->
    
  </body>
 <script type="text/javascript">
  
    window.onload = function(){
          render(data);
	}
	
   function to_authentication(authentication,type,id){
    	 
    	 
    	 if(authentication==1){
    	   	     jAlert("已认证通过","提示");
    	   	     return;
    	 }else{
    	 
    	     	 if(type==1){
    	 
		    	   url='<%=request.getContextPath() %>/after/user/approvePerson?id='+id;
		    	   
		    	 }else if(type==2){
		    	 
		    	   url='<%=request.getContextPath() %>/after/user/approveFirm?id='+id;
		    	   
		    	 }
		        window.location.href=url;
    	 }

   }
 
 </script>
</html>
